

struct BufType
{
 int i;
 float f;
 double d;
};

StructureBuffer<BufType>Buffer0:register(t0);
StructureBuffer<BufType>Buffer1:register(t1);
RWStructuredBuffer<BufType>BufferOut:register(u0);

[numthreads(1,1,1)]
void CSMain(uint3 DTid:SV_DispatchThreadID)
{
  BufferOut[DTid.x].i=Buffer0[DTid.x].i+Buffer1[DTid.x].i;
  BufferOut[DTid.x].f=Buffer0[DTid.x].f+Buffer1[DTid.x].f;
  BufferOut[DTid.x].d=Buffer0[DTid.x].d+Buffer1[DTid.x].d;
}